<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .flex1{
      display: flex;

      /* 垂直  center 居中   flex-start 居顶   flex-end 居低*/
      align-items: center;
    }

    .flex2{
      display: flex;
      align-items: flex-start;
    }

    .box{
      flex: 1;
      border: 1px solid #333;
    }
    .box.box-flex2{
      flex: 2;
    }

    /* flex  一个盒子里 里面有10个元素  如果都是1  那么每个元素都是占10分之一 如果一个2其他都是1  那么其他是占11分支1  2占11分支2 */
    .box.box-flex3{
      flex: 3;
    }

    .box-flex3{
      line-height: 100px;
    }
  </style>
</head>
<body>
  flex1
  <div class="flex1">
    <div class="box">box1</div>
    <div class="box box-flex2">
      box2
    </div>
    <div class="box">box4</div>
    <div class="box">box5</div>
    <div class="box">box6</div>
    <div class="box">box7</div>
  </div>

  flex2
  <div class="flex2">
    <div class="box">box1</div>
    <div class="box box-flex3">
      box2
    </div>
    <div class="box">box4</div>
  </div>
</body>
</html>